//
//  LCUPInfoNetworking.m
//  NetDemo
//
//  Created by admin on 2019/4/19.
//  Copyright © 2019年 admin. All rights reserved.
//

#import "LCUPInfoNetworking.h"
#import "NetworkTool.h"

@interface LCUPInfoNetworking ()

@end

@implementation LCUPInfoNetworking

IMPLEMENTATION_SINGLETON(LCUPInfoNetworking)

+ (void)open {
    NSDictionary *params = @{
                             @"action_code":        @"open",
                             };
    
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        //NSLog(@"upOSInfo dict = %@", dict);
    } failure:^(NSError *error) {
        //NSLog(@"error = %@", error);
    }];
    
}

+ (void)upLoginWithTel:(NSString *)tel uid:(NSString *)uid{
    NSDictionary *params = @{
                             @"action_code":        @"login",
                             @"tel":                 tel,
                             @"uid":                 uid,
                             };
    
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        NSLog(@"upOSInfo dict = %@", dict);
    } failure:^(NSError *error) {
        NSLog(@"error = %@", error);
    }];
}

+ (void)upRegisterWithTel:(NSString *)tel {
    NSDictionary *params = @{
                             @"action_code":        @"register",
                             @"tel":                 tel,
                             };
    
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        //NSLog(@"upOSInfo dict = %@", dict);
    } failure:^(NSError *error) {
        //NSLog(@"error = %@", error);
    }];
}
+ (void)buy_product:(NSString *)order_id :(NSString *)uid{
    NSDictionary *params = @{
                             @"action_code":        @"buy_product",
                             @"json_data":[NSString stringWithFormat:@"{\"order_id\":%@}",order_id],
                             @"uid":                 uid,
                             };
    
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        NSLog(@"upOSInfo dict = %@", dict);
    } failure:^(NSError *error) {
        NSLog(@"error = %@", error);
    }];
}
+ (void)product_details:(NSString *)product_id {
    NSDictionary *params = @{
                             @"action_code":        @"product_details",
                             @"json_data":[NSString stringWithFormat:@"{\"product_id\":%@}",product_id],
                             };
    
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        //NSLog(@"product_details dict = %@", dict);
    } failure:^(NSError *error) {
        //NSLog(@"error = %@", error);
    }];
    
}

+ (void)tongqu_home {
    NSDictionary *params = @{
                             @"action_code":        @"tongqu_home",
                             };
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        //NSLog(@"tongqu_home dict = %@", dict);
    } failure:^(NSError *error) {
        //NSLog(@"error = %@", error);
    }];
    
}

+ (void)quick_order:(NSString *)product_id {
    NSDictionary *params = @{
                             @"action_code":        @"quick_order",
                             @"json_data":[NSString stringWithFormat:@"{\"product_id\":%@}",product_id],
                             };
    
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        //NSLog(@"quick_order dict = %@", dict);
    } failure:^(NSError *error) {
        //NSLog(@"error = %@", error);
    }];
    
}

+ (void)add_cart:(NSString *)product_id {
    NSDictionary *params = @{
                             @"action_code":        @"add_cart",
                             @"json_data":[NSString stringWithFormat:@"{\"product_id\":%@}",product_id],
                             };
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        //NSLog(@"add_cart dict = %@", dict);
    } failure:^(NSError *error) {
        //NSLog(@"error = %@", error);
    }];
    
}

+ (void)search_product:(NSString *)search_infoStr {
    NSDictionary *params = @{
                             @"action_code":        @"search_product",
                             @"json_data":[NSString stringWithFormat:@"{\"search_info\":%@}",search_infoStr],
                             };
    [kNetworkTool GETWithUrlString:kNetworkTool.upLoadUrl parameters:params success:^(NSDictionary *dict) {
        //NSLog(@"search_product dict = %@", dict);
    } failure:^(NSError *error) {
        //NSLog(@"error = %@", error);
    }];
}


@end
